package cc.linker.steplink.crm.merchanth5.util.Timer;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

/**
 *
 * @author wensh.zhu
 * @date 2018-04-22
 */
public class DateUtils {
    public static final String DEFAULT_PATTERN = "yyyy-MM-dd HH:mm:ss";
    private static SimpleDateFormat sdf=new SimpleDateFormat(DEFAULT_PATTERN);

    public static String now() {
        Date time = new Date();
        return sdf.format(time);
    }

    public static String plusSeconds(int seconds) {
        Date time = new Date();
        Calendar calendar = Calendar.getInstance();
        calendar.setTime(time);
        calendar.set(Calendar.SECOND,calendar.get(Calendar.SECOND) + seconds);
        return sdf.format(calendar.getTime());
    }
}